﻿@model CMS.UI.Models.FormModel
@using Recaptcha.Web.Mvc

<form id="@("form" + @Model.FormID)" action="@Url.Action("SaveFormSubmission", "Website")" class="webForm customForm" enctype="application/x-www-form-urlencoded" method="post">
    <h1>@Model.Name</h1>
    <div class="noLabel">
        <span>* Required Fields</span>
    </div>

    @CMSHelpers.FormItems(Model.FormItems)

    <div class="noLabel">
        @Html.Recaptcha(publicKey: Model.PublicKey, theme: Recaptcha.Web.RecaptchaTheme.White)
        <span id="@("validationSummary" + @Model.FormID)" class="validation-summary-errors"></span>
    </div>
    <div class="noLabel">
        @Html.HiddenFor(m => m.FormID)
        @Html.HiddenFor(m => m.RecipientEmail)
        <input type="submit" value="Send" />
        <input type="reset" value="Reset" />
    </div>
</form>
<div id="@("emailSent" + @Model.FormID)" style="display: none;">
    <h1>Contact @Model.CompanyName</h1>
    <div>Your request was sent to our team.</div>
</div>